package cn.mysource.org.service.impl;

import cn.mysource.basic.service.impl.BaseServiceImpl;
import cn.mysource.basic.util.PageList;
import cn.mysource.org.domain.Department;
import cn.mysource.org.domain.Employee;
import cn.mysource.org.domain.Shop;
import cn.mysource.org.mapper.EmployeeMapper;
import cn.mysource.org.query.EmployeeQuery;
import cn.mysource.org.service.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;

@Service
@Transactional(readOnly = true,propagation = Propagation.SUPPORTS)
public class EmployeeServiceImpl extends BaseServiceImpl<Employee> implements IEmployeeService{

    @Autowired
    private EmployeeMapper mapper;
    @Override

    public List<Employee> findByEmp(Long id) {
        return mapper.findByEmp(id);
    }
//    @Autowired
//    private EmployeeMapper mapper;
//
//    @Override
//    public Employee findById(Long id) {
//        return mapper.findById(id);
//    }
//
//    @Override
//    public List<Employee> findAll() {
//        return mapper.findAll();
//    }
//
//    @Override
//    public void add(Employee employee) {
//        mapper.add(employee);
//    }
//
//    @Override
//    public void update(Employee employee) {
//        mapper.update(employee);
//    }
//
//    @Override
//    public void delete(Long id) {
//        mapper.delete(id);
//    }
//
//    @Override
//    public PageList<Employee> queryByPage(EmployeeQuery query) {
//        // 查询 条数
//        Integer totals = mapper.queryByCount(query);
//        if (null == totals || 0 == totals){
//            return new PageList<Employee>(0,new ArrayList<>());
//        }
//
//        List<Employee> rows = mapper.queryByPage(query);
//        return new PageList<>(totals,rows);
//    }
//
//    @Override
//    public void batchDelete(List<Long> ids) {
//        mapper.batchDelete(ids);
//    }
//
//    @Override
//    public List<Department> findDeptAll() {
//        return mapper.findDeptAll();
//    }
//
//    @Override
//    public List<Shop> findShopAll() {
//        return mapper.findShopAll();
//    }
}